﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MebAppMarketplace.Model
{
    public class App : BaseModel
    {
        public Guid OwnerID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Manufacturer { get; set; }
        /// <summary>
        /// 在商店中的目录结构，表示方式[分类1的ID]>[分类2的ID]>[分类3的ID]
        /// </summary>
        public string CategoryPath { get; set; }
        /// <summary>
        /// 是否官方应用
        /// </summary>
        public bool IsOfficalApp { get; set; }
        public string Publisher { get; set; }
        public int Version { get; set; }

        /// <summary>
        /// 相对目录
        /// </summary>
        public string Location { get; set; }
        public byte[] Icon { get; set; }
        /// <summary>
        /// 上线时间
        /// </summary>
        public DateTime OLTime { get; set; }

        /// <summary>
        /// 开发者可以阻止对应版本的下载
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 下载次数
        /// </summary>
        public int NDownload { get; set; }

        /// <summary>
        /// 是否首页推荐
        /// </summary>
        public bool HomeRecommend { get; set; }
        /// <summary>
        /// 是否分类推荐
        /// </summary>
        public bool CategoryRecommend { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        public int Price { get; set; }

        /// <summary>
        /// 新版JSON数据，审核后替换
        /// </summary>
        public string NewApp { get; set; }
    }



    /// <summary>
    /// 版本历史
    /// </summary>
    public class AppVersion : BaseModel
    {
        public Guid AppID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Manufacturer { get; set; }
        public int Version { get; set; }
        public int NDownload { get; set; }
        /// <summary>
        /// 安装包路径
        /// </summary>
        public string Location { get; set; }
        public byte[] Icon { get; set; }
        public DateTime OLTime { get; set; }
        public int Price { get; set; }
        /// <summary>
        /// 开发者可以阻止对应版本的下载
        /// </summary>
        public bool Enabled { get; set; }
    }
}
